package com.example.configdemo.controller;

import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping("/log")
@RestController
public class LogController {
    //private static Logger logger = LoggerFactory.getLogger(LogController.class);

    @PostConstruct
    public void print(){
        System.out.println("日志");
        //Slf4j 生成的是一个 log
        log.info("这是一个日志");
    }
}
